<?php 
namespace Textblast;

require_once 'member.php';

if(isset($_GET['query'])) {

	$page = $_GET['page'];
	$limit = $_GET['rp'];
	$offset = $limit * ($page - 1);
	$query = json_decode($_GET['query'], true);
	$orgID = addslashes($query['orgID']);

	$pdo = Member::getMemberList($orgID, $limit, $offset);
	$data = array();
	$data['page'] = $page;
	$data['total'] = $pdo->rowCount();
	$data['rows'] = $pdo->fetchAll();
	// return results
	echo json_encode($data);	
	exit;
} else {
	$pdo = Member::getMember(1);

	exit;
}


?>